package com.shivandragon.utils;

public class CharEscapeUtils {

	public static String escape(String str) {
		if(str==null || str.equals("")) {
			return str;
		}
		str = str.replaceAll("'", "&#x27;");
		str = str.replaceAll("\\n", " ");
		str = str.replaceAll("\\\\", "&#92;");
		str = str.replaceAll("/", "&#47;");
		str = str.replaceAll("\"", "&quot;");		
		str = str.replaceAll("<", "&lt;");
		str = str.replaceAll(">", "&gt;");
		
		return str;
	}
}
